<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@	page import="java.util.*"%>
<%
	Random rand = new Random();
	int num = rand.nextInt(100000);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html:html>
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="css/form.css" type="text/css">

<script type="text/javascript" src="js/jquery.columnfilters.js?v=<%=num%>"></script>
<script type="text/javascript" src="js/yunyshaMaster.js?v=<%=num%>"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$('table#filterTable1').columnFilters({alternateRowClassNames:['rowa','rowb']});
	});
</script>

<style type="text/css">
table tr th {
	background-color: #d3DADE;
	padding: 3px;
}
table tr.rowb { background-color:#EAf2FD; }

table tr.filterColumns td { padding:2px; }

body { padding-bottom:150px; }

</style>

    <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/redmond/jquery-ui.css" />
    <link rel="stylesheet" type="text/css" href="css/ui.jqgrid.css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
    <script type="text/javascript" src="js/grid.locale-en.js"></script>
    <script type="text/javascript" src="js/jquery.jqGrid.min.js"></script>

 <script type="text/javascript">
    //<![CDATA[
    $(function(){
        var myGrid = $("#testgrid");
        myGrid.jqGrid({
            url:"http://localhost:8080/Yunysha/CompanyMasterServlet",
            datatype: 'json',
            mtype: 'POST',
            height: 250,
            colNames:['Code','Name', 'Status','Zone','State','City'],
            colModel:[
//                 {name:'id',index:'id', width:62, sorttype:"int", key:true, search:false},
                {name:'Code',index:'Code', width:70, sorttype:"string",search:true},
                {name:'Name',index:'Name', width:62,search:true,sorttype:"int"},
                {name:'Status',index:'Status', width:68,sorttype:"string",search:true, align:"right"},
                {name:'Zone',index:'Zone', width:44, align:"right",sorttype:"float",search:true},
                {name:'State',index:'State', width:54,align:"right",sorttype:"float",search:true},
                {name:'City',index:'City', width:60, sortable:false,search:true}
            ],
            multiselect: true,
            multiboxonly:true,
            caption: "Search Results",
            pager: '#testgridpager',
            gridview: true,
            pgbuttons:false,
            pgtext:'',
            shrinkToFit: false,
            width: ($.browser.webkit?466:497),
            loadonce: true,
            sortname: 'id',
            sortorder: 'asc',
            multiselect: true,
            hoverrows: false,
            rowNum: 2000,
            jsonReader : { cell: "" }
        });

        //toolbar search
        myGrid.jqGrid('filterToolbar',{stringResult:true,searchOnEnter:false});
    });
    //]]>
    </script>


</head>
<body>
<jsp:include page="header.jsp" />
<jsp:include page="menu.jsp" /><div class="main_content">
<div>

<div style="margin-left:10px">

<div class="sectionheading">Company Master</div>

<div class="clear">&nbsp;</div>
<div style="padding-left:10px">
<div align="center">
 <table id="testgrid" align="center"><tr><td/></tr></table>
    <div id="testgridpager"></div>
    </div>
    </div>
<!-- <table id="filterTable1" cellspacing="0" cellpadding="0">
<thead>
<tr>
	<th>Code</th>
	<th>Name</th>
	<th>Status</th>  
	<th>Zone</th>
	<th>State</th>
	<th>City</th>
</tr>
</thead>
<tfoot></tfoot>
<tbody>

<tr>
	<td>NS1</td><td>test 1</td><td>Active</td><td>North</td><td>Delhi</td><td>Delhi</td>
</tr>

<tr>
	<td>NS2</td><td>Test 2</td><td>Active</td><td>North</td><td>Delhi</td><td>Delhi</td>
</tr>

<tr>
	<td>WS1</td><td>Test 3</td><td>Active</td><td>West</td><td>Maharashtra</td><td>Mumbai</td>
</tr>

<tr>
	<td>WS2</td><td>Test 4</td><td>Active</td><td>West</td><td>Maharashtra</td><td>Mumbai</td>
</tr>

<tr>
	<td>WS3</td><td>Test 5</td><td>Active</td><td>West</td><td>Gujarat</td><td>Ahmedabad</td>
</tr>
</tbody>
</table>-->
<div style="background:#f7fbfe" class="butonhldr">
		<table width="60%" height="40" cellspacing="0" cellpadding="0" border="0">
			<tbody><tr>
				<td width="25%">&nbsp;</td>
				<td width="65%">&nbsp;</td>

				<td width="10%"><a onclick="" href="#" class="tablelevelbuttn"><span>Add New Company</span></a></td>
			</tr>
		</tbody></table>
		</div>
</div>

<ul id="thicktabs" style="margin-top:40px;margin-left:5px">
	<li><a id="tab-1" href="#" onclick="changeTabs('1')">Client Info</a></li>
	<li><a id="tab-2" href="#" onclick="changeTabs('2')">Shipping and Billing Info</a></li>
	<li><a id="tab-3" href="#" onclick="changeTabs('3')">Pricing Info</a></li>
	</ul>
<br style="clear: left" />
<form name="input" action="http://localhost:8080/Yunysha/companyMaster.do?subAction=save" method="post">
<div class="tab_div">
<table id="fragment-1" style="">
<tr>
<td>Customer Code</td>
<td>
<input type="text" id="txtCode" name="txtCode" class="text_field_required" size="31" disabled="disabled" />
</td> 
</tr>
<tr>
<td>Company Name</td>
<td>
<input type="text" id="txtCompanyName" name="txtCompanyName" class="text_field_required" size="31"/>
</td>
<td>Customer Handled By</td>
<td>
 <select class="Country_field_required" id="txtCustHandledBy" name="txtCustHandledBy">
     <option selected="selected" value="">---Select---</option>
     <option value="Sehul Shah">Sehul Shah</option>
     <option value="Amit Jhaveri">Amit Jhaveri</option>
      <option value="Jatin Suthar">Jatin Suthar</option>
     
   	</select>  

</td>
</tr>
<tr>
<td>Category</td>
<td> <select class="Country_field_required" id="txtCCategory" name="txtCCategory">
     <option selected="selected" value="">---Select---</option>
     <option value="A">A</option>
     <option value="B">B</option>
     <option value="C">C</option>
     <option value="D">D</option>
     <option value="E">E</option>
	</select>       
</td>
<td>Status</td>
<td> <select class="Country_field_required" id="txtCStatus" name="txtCStatus">
     <option selected="selected" value="">---Select---</option>
     <option value="Active">Active</option>
     <option value="Inactive">Dead</option>

   	</select>         
</td>
</tr>
<tr>
<td>State</td>
<td>  <select class="Country_field_required" id="txtCState" name="txtCState">
     <option selected="selected" value="">---Select---</option>
     <option value="Andaman and Nicobar" onclick="setcityoptions('Andaman and Nicobar')">Andaman and Nicobar</option>
     <option value="Gujarat" onclick="setcityoptions('Andhra Pradesh')">Andhra Pradesh</option>
     <option value="Karnataka" onclick="setcityoptions('Arunachal Pradesh')">Arunachal Pradesh</option>
    <option value="Delhi" onclick="setcityoptions('Assam')" >Assam</option>
     <option value="Rajasthan" onclick="setcityoptions('Bihar')">Bihar</option>
	 <option value="Rajasthan" onclick="setcityoptions('Chandigarh')">Chandigarh</option>
	 <option value="Rajasthan" onclick="setcityoptions('Chattisgarh')">Chattisgarh</option>
	 <option value="Rajasthan" onclick="setcityoptions('Goa')">Goa</option>
	 <option value="Rajasthan" onclick="setcityoptions('Gujarat')">Gujarat</option>
	 <option value="Rajasthan" onclick="setcityoptions('Haryana')">Haryana</option>
	 <option value="Rajasthan" onclick="setcityoptions('Himachal Pradesh')">Himachal Pradesh</option>
	 <option value="Rajasthan" onclick="setcityoptions('Jammu And Kashmir')">Jammu And Kashmir</option>
	 <option value="Rajasthan" onclick="setcityoptions('Jharkhand')">Jharkhand</option>
	 <option value="Rajasthan" onclick="setcityoptions('Karnataka')">Karnataka</option>
	 <option value="Rajasthan" onclick="setcityoptions('Kerala')">Kerala</option>
	 <option value="Rajasthan" onclick="setcityoptions('Madhya Pradesh')">Madhya Pradesh</option>
	 <option value="Rajasthan" onclick="setcityoptions('Maharashtra')">Maharashtra</option>
     <option value="Rajasthan" onclick="setcityoptions('Haryana')">Haryana</option>
	 <option value="Rajasthan" onclick="setcityoptions('Himachal Pradesh')">Himachal Pradesh</option>
	 <option value="Rajasthan" onclick="setcityoptions('Jammu And Kashmir')">Jammu And Kashmir</option>
	 <option value="Rajasthan" onclick="setcityoptions('Jharkhand')">Jharkhand</option>
	 <option value="Rajasthan" onclick="setcityoptions('Karnataka')">Karnataka</option>
	 <option value="Rajasthan" onclick="setcityoptions('Kerala')">Kerala</option>
	 <option value="Rajasthan" onclick="setcityoptions('Madhya Pradesh')">Madhya Pradesh</option>
	 <option value="Rajasthan" onclick="setcityoptions('Maharashtra')">Maharashtra</option>
	 <option value="Rajasthan" onclick="setcityoptions('New Delhi')">New Delhi</option>
	  <option value="Rajasthan" onclick="setcityoptions('Orissa')">Orissa</option>
	 <option value="Rajasthan" onclick="setcityoptions('Puducherry')">Puducherry</option>
	 <option value="Rajasthan" onclick="setcityoptions('Punjab')">Punjab</option>
	 <option value="Rajasthan" onclick="setcityoptions('Rajasthan')">Rajasthan</option>
	 <option value="Rajasthan" onclick="setcityoptions('Tamil Nadu')">Tamil Nadu</option>
	 <option value="Rajasthan" onclick="setcityoptions('Uttar Pradesh')">Uttar Pradesh</option>
	 <option value="Rajasthan" onclick="setcityoptions('Uttaranchal')">Uttaranchal</option>
	 <option value="Rajasthan" onclick="setcityoptions('West Bengal')">West Bengal</option>
	 
	 	


	</select>        
</td>

<td>City</td>
<td> <select class="Country_field_required" id="txtCCity" name="txtCCity">
     <option selected="selected" value="">---Select---</option>
    
	</select>    </td>
</tr>
<tr>
<td>Zone</td>
<td>  
	<select class="Country_field_required" id="txtCZone" name="txtCZone">
     <option selected="selected" value="">---Select---</option>
      <option  value="East">East</option>
       <option value="West">West</option>
        <option value="North">North</option>
         <option value="South">South</option>
     
	</select>       
</td>
<td>Address</td>
<td>
 <input type="text" id="txtCAddress" name="txtCAddress" class="text_field_required" />
</td>
</tr>
<tr><td>&nbsp;</td></tr>

<tr><td>Owner/Partner Details</td></tr>
<tr>
<td colspan="4">
	<table class="documenttable" id="ownerContact_tbl">
		<tbody id="ownerContact_body"><tr>
			<th>Position</th>
			<th>Name</th>
			<th>Landline Number</th>
			<th>Mobile Number</th>
			<th>Email Id</th>
			<th>Fax Number</th>
			<th>Pincode</th>
			<th><img src="images/button_header_add_user.gif" height="20px" onclick="addNewContactRow()" title="Add New Row"></th>
		</tr>
		<tr id="contactRow1">
<td>
<select class="Country_field_required" id="txtContactPosition1" name="txtContactPosition1">
<option value="" selected="selected">--Select--</option>
<option value="Owner/Partner">Owner/Partner</option>
<option value="Order Concerned Person">Order Concerned Person</option>
<option value="Accountant">Accountant</option>
<option value="Clerk">Clerk</option>
<option value="Others">Others</option>
</select>
</td>

<td><input type="text" size="10" class="text_field_required" name="txtContactName1" id="txtContactName1"></td>
		<td><input type="text" size="15" class="text_field_required" name="txtContactNo1" id="txtContactNo1"></td>
		<td><input type="text" size="15" class="text_field_required" name="txtContactMobileNo1" id="txtContactMobileNo1"></td>
		<td><input type="text" size="15" class="text_field_required" name="txtContactEmail1" id="txtContactEmail1"></td>
		<td><input type="text" size="15" class="text_field_required" name="txtContactFax1" id="txtContactFax1"></td>
		<td><input type="text" size="15" class="text_field_required" name="txtContactPincode1" id="txtContactPincode1"></td>
		<td></td></tr>
	</tbody></table>
</td>
</tr>

<tr><td>&nbsp;</td></tr>
<tr><td><div style="background:#f7fbfe" class="butonhldr">
		<table width="100%" height="40" cellspacing="0" cellpadding="0" border="0">
			<tbody><tr>
				<td width="25%">&nbsp;</td>
				<td width="65%">&nbsp;</td>

				<td width="10%"><input type="button" style="background: url(images/next.gif) no-repeat; border: none; height: 28px; width: 68px;" onclick="javascript: validatePersonalDetails()" id="showcontent2" class="nexttabbutton" value=""></td>
			</tr>
		</tbody></table>
		</div></td></tr>
</table>
<table id="fragment-2" style="display:none">
<tr><td>
Shipping Address
</td>
<td>
 <textarea id="txtCShippingAddress" name="txtCShippingAddress" rows="3" cols="40">
 </textarea>
</td>
<td>
Billing Address
</td>
<td>
 <textarea id="txtCBilllingAddress" name="txtCBilllingAddress" rows="3" cols="40">
 </textarea>
</td>
</tr>
<tr>
<td>Pan No</td>
<td><input type="text" value="" id="txtCPanNo" name="txtCPanNo" class="text_field_required" size="30"></td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr>
<tr>
<td>VAT TIN No LST</td>
<td><input type="text" value="" id="txtCVatTinNo1" name="txtCVatTinNo1" class="text_field_required" size="30"></td>
<td>VAT TIN No CST</td>
<td><input type="text" value="" id="txtCVatTinNo2" name="txtCVatTinNo2" class="text_field_required" size="30"></td>
</tr>
<tr>
<td>Payment Terms</td>
<td><input type="text" value="" id="txtCPaymentTerms" name="txtCPaymentTerms" class="text_field_required" size="30"></td>
<td>Credit Limit</td>
<td><input type="text" value="" id="txtCCreditLimit" name="txtCCreditLimit" class="text_field_required" size="30"></td>
</tr>
</table>
<table id="fragment-3" style="display:none">
<tr>
<td><u>Diamond Rates</u></td>
<td>&nbsp;</td>
</tr>

<tr>
<td colspan="2">
	<table class="documenttable" id="diamondDetails_tbl">
		<tbody id="diamondDetails_body"><tr>
			<th>Diamond Code</th>
			<th>Shape</th>
			<th>Make</th>
			<th>Clarity</th>
			<th>Color</th>
			<th>Sieve Size</th>
			<th>Weight</th>
			<th>Base Price</th>
			<th>Selling Price</th>
			<th><img src="images/button_header_add_user.gif" height="20px" onclick="addNewRow()" title="Add New Row"></th>
		</tr>
		<tr id="row1"><td><input type="text" size="10" class="text_field" name="txtCDiamondCode1" id="txtCDiamondCode1"></td>
		<td><input type="text" size="15" class="text_field" name="txtCDiamondShape1" id="txtCDiamondShape1"></td>
		<td><input type="text" size="15" class="text_field" name="txtCDiamondMake1" id="txtCDiamondMake1"></td>
		<td><input type="text" size="15" class="text_field" name="txtCDiamondClarity1" id="txtCDiamondClarity1"></td>
		<td><input type="text" size="15" class="text_field" name="txtCDiamondColor1" id="txtCDiamondColor1"></td>
		<td><input type="text" size="10" class="text_field" name="txtCDiamondSieveSize1" id="txtCDiamondSieveSize1"></td>
		<td><input type="text" size="10" class="text_field" name="txtCDiamondWeight1" id="txtCDiamondWeight1"></td>
		<td><input type="text" size="10" class="text_field" name="txtCDiamondBasePrice1" id="txtCDiamondBasePrice1"></td>
		<td><input type="text" size="10" class="text_field" name="txtCDiamondSellingPrice1" id="txtCDiamondSellingPrice1"></td>
		<td><img src="images/deleteRow.jpg" onclick="deleteRow(1)" height="20px"/></td></tr>
	</tbody></table>
</td>
</tr>

<!-- <tr>
<td>Diamond Code</td>
<td><input type="text" id="txtCDiamondCode" name="txtCDiamondCode" class="text_field_required" size="31"/></td>
<td>Shape</td>
<td><input type="text" id="txtCDiamondShape" name="txtCDiamondShape" class="text_field_required" size="31"/></td>
</tr>
<tr>
<td>Make</td>
<td><input type="text" id="txtCDiamondMake" name="txtCDiamondMake" class="text_field_required" size="31"/></td>
<td>Clarity</td>
<td><input type="text" id="txtCDiamondClarity" name="txtCDiamondClarity" class="text_field_required" size="31"/></td>
</tr>
<tr>
<td>Color</td>
<td><input type="text" id="txtCDiamondColor" name="txtCDiamondColor" class="text_field_required" size="31"/></td>
<td>Sieve Size</td>
<td><input type="text" id="txtCDiamondSieveSize" name="txtCDiamondSieveSize" class="text_field_required" size="31"/></td>
</tr>
<tr>
<td>Weight</td>
<td><input type="text" id="txtCDiamondWeight" name="txtCDiamondWeight" class="text_field_required" size="31"/></td>
<td>Base Price</td>
<td><input type="text" id="txtCDiamondBasePrice" name="txtCDiamondBasePrice" class="text_field_required" size="31"/></td>
</tr>
<tr>
<td>Selling Price</td>
<td><input type="text" id="txtCDiamondSellingPrice" name="txtCDiamondSellingPrice" class="text_field_required" size="31"/></td>
</tr> -->
<tr>
<td><u>Labour Rates</u></td>
</tr>
<tr>
<td width="25%">Category</td>
<td>Amount</td>
</tr>
<tr>
<td>L1</td>
<td><input type="text" id="txtCCategoryAmt1" name="txtCCategoryAmt1" class="text_field_required" size="31"/></td>
</tr>
<tr>
<td>L2</td>
<td><input type="text" id="txtCCategoryAmt2" name="txtCCategoryAmt2"  class="text_field_required" size="31"/></td>
</tr>
<tr>
<td>L3</td>
<td><input type="text" id="txtCCategoryAmt3" name="txtCCategoryAmt3"  class="text_field_required" size="31"/></td>
</tr>
<tr>
<td>Mark-up/Discount</td>
<td><input type="text" id="txtDiscount" name="txtDiscount"  class="text_field_required" size="31"/></td>
</tr>

<tr>
<td><input type="submit" value="Submit"></td>
</tr>
</table>
</div>
<input type="hidden" id="contactCount" name="contactCount" value="1">
<input type="hidden" id="diamondCount" name="diamondCount" value="1">
</form>
<p class="iepara"></p>
</div>
</div>


<br />

</body>
</html:html>